package com.spzx.product.service.impl;

import com.spzx.common.security.annotation.GuiGuCache;
import com.spzx.product.domain.ProductDetails;
import com.spzx.product.mapper.ProductDetailsMapper;
import com.spzx.product.service.IProductDetailsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * <p>
 * 商品sku属性表 服务实现类
 * </p>
 *
 * @author lee
 * @since 2024-07-15
 */
@Service
public class ProductDetailsServiceImpl extends ServiceImpl<ProductDetailsMapper, ProductDetails> implements IProductDetailsService {

    @Override
    @GuiGuCache(prefix = "ProductDetails:")
    public List<String> getProductDetails(Long id) {
        String detailsImageUrl = baseMapper.getDetailsImageUrl(id.intValue());
        List<String> detailsImageUrlList = Arrays.stream(detailsImageUrl.split(",")).toList();
        return detailsImageUrlList;
    }
}
